﻿create PROCEDURE Sync.SP_ProjectStages_SelectChanges
@LastRowVersion rowversion,
@FilterdColumn UNIQUEIDENTIFIER
AS 
BEGIN 
	SELECT 
        t.[ProjectStageID],
		g.[ProjectID],g.[Stage],g.[AgeLimit],g.[From],g.[To],
		t.IsDeleted,
		t.LastUpdatedDate
	FROM [dbo].[ProjectStages] g RIGHT JOIN Sync.ProjectStages_Tracking t  
    ON t.ProjectStageID = g.ProjectStageID 
	WHERE @LastRowVersion IS NULL OR t.Version > @LastRowVersion
    END














